package com.cgwx.testservice.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cgwx.springsecurity.entity.SysLoginLog;
import com.cgwx.springsecurity.entity.SysLoginLogQueryVo;
import com.cgwx.springsecurity.service.SysLoginLogService;
import com.cgwx.testservice.client.SystemClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author GaoWei
 * @Date 2023/10/28 - 13:35
 */

@Service
public class TestSysLoginLogServiceImpl implements SysLoginLogService {

    @Autowired
    private SystemClient systemClient;

    @Override
    public void recordLoginLog(String username, Integer status, String ipaddr, String message) {
        systemClient.recordLoginLog(username, status, ipaddr, message);
    }

    @Override
    public IPage<SysLoginLog> selectPage(Page<SysLoginLog> pageParam, SysLoginLogQueryVo sysLoginLogQueryVo) {
        return systemClient.selectLoginPage(pageParam.getPages(), pageParam.getMaxLimit(), sysLoginLogQueryVo);
    }
}
